<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content=
            "maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>信息追加</title>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/rams.css"/>

    <style>
        .aui-bar-nav{
            background-color: #e10010;
        }
        .aui-icon-left{
            font-size: 0.7rem;
            font-weight: 700;
        }

    </style>
</head>
<body>
<div class="bodyContainer bodyPosition">
    <header class="aui-bar aui-bar-nav headerMarginTop">
        <div class="aui-pull-left aui-btn">
            <span class="aui-iconfont aui-icon-left"></span><span class="aui-Font" onclick="api.closeWin()">返回</span>
        </div>
        <div class="aui-title">信息追加</div>
        <div class="aui-pull-right header_confirm">
            <span class="aui_Font" onclick="save()">确定</span>
        </div>
    </header>
    <div class="infoMarginTop">
        <div id="workSheet_area" class="aui-padded-l-15">
            <!--追加内容-->
            <div>
                <div>
                    <span class="redStar">*</span>
                    追加内容：
                </div>
                <div>
                    <textarea  placeholder="请输入" id="appendMessage"></textarea>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    apiready = function () {
    }
    function save() {
        var remark = $api.trim($api.val($api.byId('appendMessage')));       //追加内容
        var wsNum = $api.getStorage(storageKey.wsNum);       //工单号
        var processId = $api.getStorage(storageKey.processId);     //流程id
        var imgID = "";     //图片信息
        if(common.isEmpty(remark)){
            api.toast({
                msg: '追加信息不能为空！',
                duration: config.duration,
                location: 'middle'
            });
            return;
        }
        api.confirm({
            title: '信息追加',
            msg: '是否提交？',
            buttons: ['确定', '取消']
        }, function(retBtn, err) {
            if(retBtn.buttonIndex===1){
                common.post({
                    url:config.appendMessageUrl,
                    isLoading: true,
                    text: "提交中...",
                    data:{
                        wsNum:wsNum,
                        processId:processId,
                        remark: remark,
                        imgID:imgID
                    },
                    success: function (ret) {
                        if (ret.status==='200'){
                            api.alert({
                                title: '提示',
                                msg: '信息追加操作成功！',
                            }, function (ret, err) {
                                common.closeAndReloadAppointPage('process_success_reload_worksheet_detail');
                            });
                        } else {
                            // 因为返回的错误信息是英文，所有没有单独显示错误信息。
                            api.toast({
                                msg:  '信息追加操作失败！',
                                duration: config.duration,
                                location: 'middle'
                            });
                        }
                    }
                });
            }
        });
    }

</script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/doT.min.js"></script>
<script type="text/javascript" src="../../script/config.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
</body>
</html>
